package Libs.Utils.Strings
{
	public const Center:Function = function( source:String, size:uint = 0 , separator:String = " " ):String 
    {
        if ( source == null )
        {
            return "" ;
        }
        var len:int = source.length ;
        if ( len <= size )
        {
            len = size - len ;
            var remain:String = ( len % 2 == 0 ) ? "" : separator;
            var pad:String = Repeat( separator , int( len / 2 ) );
            return pad + source + pad + remain;
        }
        else
        {
            return source ;
        }
    };
}